#![no_std]
#![no_main]

use limine::BaseRevision;

extern crate kernel;

#[used]
#[link_section = ".requests"]
static BASE_REVISION: BaseRevision = BaseRevision::new();

static ULOADER_BUF: &[u8] = include_bytes!(env!("CARGO_BIN_FILE_ULOADER_uloader"));
static INIT_BUF: &[u8] = include_bytes!(env!("CARGO_BIN_FILE_INIT_init"));

#[no_mangle]
extern "C" fn kmain() -> ! {
    kernel::init();

    kernel::context::process::Process::new_user_process(
        "init",
        INIT_BUF,
        kernel::acpi::RSDP_ADDRESS.clone(),
        0,
    );

    kernel::context::process::Process::new_user_process("uloader", ULOADER_BUF, 0, 0);

    loop {
        x86_64::instructions::interrupts::enable_and_hlt();
    }
}
